#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

string s1, s2;
const int N = 1e5 + 10;
int a[N], b[N], c[N];

int main()
{
	int flag = 0;
	cin >> s1 >> s2;
	if (s1.size() < s2.size())
	{
		swap(s1, s2);
		flag = 1;
	} 
	else if (s1.size() == s2.size())
	{
		for (int i = 0; i<s1.size(); i++)
		{
			if (s2[i] > s1[i])
			{
				swap(s1, s2);
				flag = 1;
				break;
			}
			else if (s1[i] > s2[i])
			{
				break;
			}
		}
	}
	
	int j = 1, k = 1;
	for(int i=s1.size()-1;i>=0;i--)
	{ 
		a[j++]=s1[i] - '0';
	}
	for (int i = s2.size() - 1; i >= 0; i--)
	{
		b[k++] = s2[i] - '0';
	}
	int ma = s1.size();
	for (int i = 1; i <= ma; i++)
	{
		if (a[i] < b[i])
		{
			a[i] += 10;
			a[i + 1] -= 1;
		}
		c[i] = a[i] - b[i];
	}
	while (c[ma] == 0 && ma > 1)
	{
		ma--;
	}
	if (flag)
	{
		cout << "-";
	}
	for (int i = ma; i >= 1; i--)
	{
		cout << c[i];
	}
	return 0;
}